<template>
	<view class="wo-page" v-show="pageInit">
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 考场列表
				roomList: {},
				// 列表状态
				roomListStatus: 'loadmore',
			};
		},
		methods: {
			/**
			 * 页面初始化后执行
			 * @param {Object} option
			 */
			async initPageFunc(option) {
				let retest = option.retest || 0;
				let roomList = null;
				// 获取考场列表
				if (retest == 1) {
					roomList = await this.roomListFunc({
						search: {
							retest_enable: 1
						}
					});
				} else {
					roomList = await this.roomListFunc({
						search: {
							retest_enable: 2
						}
					});
				}
				if (roomList) {
				    this.roomList = roomList;
				}
			    this.pageInit = true;
			},
			async roomListFunc(params) {
			    params = params || {};
			    this.roomListStatus = 'loading';
			    let roomList = await this.$u.api.roomList(params);
			    if (!roomList) {
			        return false;
			    }
			    this.roomListStatus = 'loadmore';
			    return roomList;
			},
		}
	}
</script>

<style lang="scss">

</style>
